<#ibizinclude>
../@MACRO/MODEL/MODEL_HEADER.ts.ftl
</#ibizinclude>

	/**
	 * 是否是实体数据导出
	 *
	 * @returns {any[]}
	 * @memberof ${srfclassname('${ctrl.getCodeName()}')}${srfclassname('${ctrl.name}')}Mode
	 */
	public isDEExport: boolean = false;

	/**
	 * 获取数据项集合
	 *
	 * @returns {any[]}
	 * @memberof ${srfclassname('${ctrl.getCodeName()}')}${srfclassname('${ctrl.name}')}Mode
	 */
	public getDataItems(): any[] {
    if(this.isDEExport){
		  return [
<#--  实体导出数据项  -->
<#if ctrl.getPSDEDataExport?? && ctrl.getPSDEDataExport()?? && ctrl.getPSDEDataExport().getPSDEDataExportItems()??>
  <#list ctrl.getPSDEDataExport().getPSDEDataExportItems() as dataitem>
        {
          name: '${dataitem.getName()}',
    <#if dataitem.getPSDEField()??>
          prop: '${dataitem.getPSDEField().getCodeName()?lower_case}',
          dataType: '${dataitem.getPSDEField().getDataType()}',
    </#if>
    <#if ctrl.getPSDEGridEditItems()??>
    <#list ctrl.getPSDEGridEditItems() as editItem>
    <#if editItem.getName() == dataitem.getName()>
    <#if editItem.isEditable()>
          isEditable:${editItem.isEditable()?c}
    </#if>
    </#if>
    </#list>
    </#if>
        },
  </#list>
</#if>
      ]
    }else{
		  return [
<#--  表格列  -->
<#if ctrl.getPSDEGridColumns()??>
  <#list ctrl.getPSDEGridColumns() as columnItem>
    <#if columnItem.getColumnType() == 'DEFGRIDCOLUMN'>
        {
          name: '${columnItem.getName()}',
    <#if columnItem.getPSDEField()??>
          prop: '${columnItem.getPSDEField().getCodeName()?lower_case}',
          dataType: '${columnItem.getPSDEField().getDataType()}',
    </#if>
    <#if ctrl.getPSDEGridEditItems()??>
    <#list ctrl.getPSDEGridEditItems() as editItem>
    <#if editItem.getName() == columnItem.getName()>
    <#if editItem.isEditable()>
          isEditable:${editItem.isEditable()?c}
    </#if>
    </#if>
    </#list>
    </#if>
        },
    </#if>
  </#list>
</#if>
<#--  表格数据项  -->
<#if ctrl.getPSDEGridDataItems()??>
  <#list ctrl.getPSDEGridDataItems() as dataitem>
    <#--  判断表格列是否已经输出过  -->
    <#assign judge = false/>
    <#if ctrl.getPSDEGridColumns()??>
      <#list ctrl.getPSDEGridColumns() as columnItem>
        <#if columnItem.getColumnType() == 'DEFGRIDCOLUMN' && dataitem.getName() == columnItem.getName()>
          <#assign judge = true/>
          <#break>
        </#if>
      </#list>
    </#if>
    <#if !judge>
        {
          name: '${dataitem.getName()}',
    <#if dataitem.getPSDEField()??>
          prop: '${dataitem.getPSDEField().getCodeName()?lower_case}',
          dataType: '${dataitem.getPSDEField().getDataType()}',
    </#if>
    <#if ctrl.getPSDEGridEditItems()??>
    <#list ctrl.getPSDEGridEditItems() as editItem>
    <#if editItem.getName() == dataitem.getName()>
    <#if editItem.isEditable()>
          isEditable:${editItem.isEditable()?c}
    </#if>
    </#if>
    </#list>
    </#if>
        },
    </#if>
  </#list>
</#if>
<#--  关联主实体的主键  -->
<#if ctrl.getPSAppDataEntity()??>
  <#assign appDataEntity = ctrl.getPSAppDataEntity() />
  <#if appDataEntity.isMajor() == false && appDataEntity.getMinorPSAppDERSs()??>
    <#list appDataEntity.getMinorPSAppDERSs() as minorAppDERSs>
      <#if minorAppDERSs.getMajorPSAppDataEntity()??>
      <#assign majorAppDataEntity = minorAppDERSs.getMajorPSAppDataEntity() />
        {
          name: '${majorAppDataEntity.getCodeName()?lower_case}',
          prop: '${minorAppDERSs.getPSDER1N().getPSPickupDEField().getCodeName()?lower_case}',
          dataType: 'FONTKEY',
        },
      </#if>
    </#list>
  </#if>
</#if>
<#if ctrl.getPSDEGridDataItems()??>
  <#list ctrl.getPSDEGridDataItems() as dataitem>
	<#-- 界面主键标识 -->
  <#if dataitem.getPSDEField?? && dataitem.getPSDEField()??>
	<#if !P.exists("importService", dataitem.getPSDEField().getId(), "")>
	 	<#if dataitem.getPSDEField().isKeyDEField() == true>
        {
          name: '${ctrl.getPSAppDataEntity().getCodeName()?lower_case}',
          prop: '${dataitem.getPSDEField().getCodeName()?lower_case}',
        },
	 	</#if>
	</#if>
  </#if>
  </#list>
</#if>
<#if view.hasPSControl('searchform')>
${P.getCtrlCode('searchform', 'MODEL_CONTENT.ts').code}
</#if>
        {
          name:'size',
          prop:'size'
        },
        {
          name:'query',
          prop:'query'
        },
        {
          name:'filter',
          prop:'filter'
        },
        {
          name:'page',
          prop:'page'
        },
        {
          name:'sort',
          prop:'sort'
        },
        {
          name:'srfparentdata',
          prop:'srfparentdata'
        },
        // 前端新增修改标识，新增为"0",修改为"1"或未设值
        {
          name: 'srffrontuf',
          prop: 'srffrontuf',
          dataType: 'TEXT',
        },
      ]
    }
  }

<#ibizinclude>
../@MACRO/MODEL/MODEL_BOTTOM.ts.ftl
</#ibizinclude>